
#ifndef __KHAN_CLI_COMMAND_MODE_H__
#define __KHAN_CLI_COMMAND_MODE_H__

#include "khan.hpp"
#include "command2.hpp"

class command_mode;
typedef boost::shared_ptr<command_mode>  command_mode_ptr;
typedef command_mode_ptr cmd_mode_ptr;

class command_mode 
: private boost::noncopyable
{
public:
    explicit command_mode(cmd_mode_ptr p, std::string name, std::string prompt, bool is_auth=false):
        _root(new command2()), _name(name), _prompt(prompt), _is_auth(is_auth),
        _parent(p)
    {
    };

    explicit command_mode(std::string name, std::string prompt, bool is_auth=false):
        _root(new command2()), _name(name), _prompt(prompt), _is_auth(is_auth)
    { 
    };

    void set_parent(command_mode_ptr p) { _parent = p; }
    command_mode_ptr get_parent() { return _parent; }

    bool is_auth() { 
        return _is_auth; 
    }
    const std::string& prompt() { return _prompt; }

    const std::string& name() { return _name; };
    //void    add_cmd(command_ptr pointer) { _cmd_list.push_back(pointer); }
    command2_ptr get_root() { return _root; };

    void    dump(int dept) 
    {
    }

private:
    cmd_list_t       _cmd_list;
    command2_ptr     _root;
    std::string      _name;
    std::string      _prompt;
    bool             _is_auth;
    command_mode_ptr _parent;
};



#endif  /* __KHAN_CLI_COMMAND_MODE_H__ */
